package com.oop2.test1;

/**
 * Created by L.jp
 * Description:
 * User: 86189
 * Date: 2022-09-18
 * Time: 20:07
 */
public class Girl {
    //属性：
    private int age;
/*    //读取年龄：
    public int duquAge(){
        return age;
    }
    //设置年龄：
    public void shezhiAge(int age){
        if(age >= 30 ){
            this.age = 18;
        }else{
            this.age = age;
        }
    }*/
    
    //读取年龄：
    public int getAge(){
        return age;
    }
    //设置年龄：
    public void setAge(int age){
        if(age >= 30 ){
            this.age = 18;
        }else{
            this.age = age;
        }
    }
}
